<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="jquery.min.js" type="text/javascript"></script>
</head>
<body>
    <form id="frm" action="http://www.baidu.com">
        <input type="submit" value="提交">
    </form>
    <script>
        function preventSubmit(formId) {
            $(function () {
                $('#'+formId).submit(function (e) {
                    e.preventDefault();
                });
            });

        }
       preventSubmit('frm');
    </script>
</body>
</html>